package com.hystericalporpoises.thingamajava.repository;

import java.util.ArrayList;
import java.util.List;

public abstract class RepositoryAggregator {

  private List<TestObjectRepository<?>> repositories = new ArrayList<TestObjectRepository<?>>();

  public RepositoryAggregator() {
    addRepositories();
  }

  protected abstract void addRepositories();

  protected final void add(TestObjectRepository<?> repository) {
    repositories.add(repository);
  }

  protected final void addFromAggregator(RepositoryAggregator aggregator) {
    repositories.addAll(aggregator.getRepositories());
  }

  public final List<TestObjectRepository<?>> getRepositories() { return this.repositories; }

}
